package com.manage.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.manage.api.entity.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author LC
 * @createTime 2021/2/17 22:48
 * @desc 用户管理表
 *
 * @EqualsAndHashCode作用：会默认生成equals和hashcode方法，用exclude排除某些属性，用of仅使用某些属性，callSuper=true让其生成的方法调用父类方法
 *
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("SYS_USER")
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 真实姓名
     */
    @TableField(value = "REAL_NAME")
    private String realName;

    /**
     * 昵称
     */
    @TableField(value = "NICK_NAME")
    private String nickName;

    /**
     * 性别：1男，2女，3未知
     */
    @TableField(value = "GENDER")
    private Integer gender;

    /**
     * 手机号码
     */
    @TableField(value = "MOBILE")
    private String mobile;

    /**
     * 邮箱
     */
    @TableField(value = "EMAIL")
    private String email;

    /**
     * 生日
     */
    @TableField(value = "BIRTHDAY")
    private Date birthday;

    /**
     * 部门id
     */
    @TableField(value = "DEPT_ID")
    private Integer deptId;

    /**
     * 职级id
     */
    @TableField(value = "LEVEL_ID")
    private Integer levelId;

    /**
     * 岗位id
     */
    @TableField(value = "POSITION_ID")
    private Integer positionId;

    /**
     * 地址
     */
    @TableField(value = "ADDRESS")
    private String address;

    /**
     * 城市名称
     */
    @TableField(value = "CITY_NAME")
    private String cityName;

    /**
     * 用户名
     */
    @TableField(value = "USERNAME")
    private String userName;

    /**
     * 密码
     */
    @TableField(value = "PASSWORD")
    private String password;

    /**
     * 盐加密
     */
    @TableField(value = "SALT")
    private String salt;

    /**
     * 简介
     */
    @TableField(value = "INTRO")
    private String intro;

    /**
     * 状态 1正常 2禁用
     */
    @TableField(value = "STATUS")
    private Integer status;

    /**
     * 备注
     */
    @TableField(value = "NOTE")
    private String note;

    /**
     * 排序
     */
    @TableField(value = "SORT")
    private Integer sort;

    /**
     * 登录次数
     */
    @TableField(value = "LOGIN_NUM")
    private Integer loginNum;

    /**
     * 登录IP
     */
    @TableField(value = "LOGIN_IP")
    private String loginIP;

    /**
     * 最近登录时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date loginTime;
}
